/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author jillsanluis
 */
public class PeerInfo {

    private Client client;
    private String username;
    private boolean localClientFlag = false;
    
    private int peerID = -1;
    private boolean hostFlag = false;

    private String ipAddress;
    private int listeningPort = -1;

    public PeerInfo(String username, Client client, boolean hostFlag, boolean localClientFlag, String ipAddress, int listeningPort){
        this.username = username;
        this.client = client;
        this.hostFlag = hostFlag;
        this.localClientFlag = localClientFlag;
        this.ipAddress = ipAddress;
        this.listeningPort = listeningPort;
        this.peerID = username.hashCode() + ipAddress.hashCode() + client.hashCode() + listeningPort;
    }

    /**
     * @return the client
     */
    public Client getClient() {
        return client;
    }

    /**
     * @return the username
     */
    public String getUsername() {
        return username;
    }

    /**
     * @return the localClientFlag
     */
    public boolean isLocalClientFlag() {
        return localClientFlag;
    }

    /**
     * @return the peerID
     */
    public int getPeerID() {

        return peerID;
    }

    /**
     * @return the hostFlag
     */
    public boolean isHostFlag() {
        return hostFlag;
    }

    /**
     * @return the listeningPort
     */
    public int getListeningPort() {
        return listeningPort;
    }

    /**
     * @return the ipAddress
     */
    public String getIPAddress() {
        return ipAddress;
    }


}
